// 替换 electron 的 fs 模块使用
// const fs = require('fs')

// 改用 File API
export const saveFile = async (content, filename) => {
  const blob = new Blob([content], { type: 'text/plain' })
  const url = window.URL.createObjectURL(blob)
  const link = document.createElement('a')
  link.href = url
  link.download = filename
  link.click()
  window.URL.revokeObjectURL(url)
} 